package algorithm.exam.array;

import java.util.HashSet;

public class containsDuplicate {
    public static boolean containsDuplicate(int[] nums) {
        HashSet set =new HashSet();
        for(int n :nums){
            if(set.contains(n)){
                return false;
            }
            set.add(n);
        }
        return true;
    }

    public static void main(String[] args) {
        int[] nums ={1,2,3,1};
        System.out.println(containsDuplicate(nums));
    }
}
